<template>
	<div class="authors">
		<div class="shi">
			<p class="name">{{obj.title}}</p>
			<p><span class="dynasty">{{obj.author}}</span> <span class="author">{{obj.dynasty}}</span></p>
			<p class="content" v-html="obj.content"></p>
		</div>
		<div class="authors_details">
			<p class="name">
				<b class="shu"></b>
				<span>译文</span>
			</p>
			<p class="content">{{obj.translation}}</p>
		</div>
		<div class="authors_details">
			<p class="name">
				<b class="shu"></b>
				<span>注释</span>
			</p>
			<p class="content">{{obj.annotation}}</p>
		</div>
		<div class="authors_details">
			<p class="name">
				<b class="shu"></b>
				<span>中心思想</span>
			</p>
			<p class="content">{{obj.intro}}</p>
		</div>
		<div class="authors_details">
			<p class="name">
				<b class="shu"></b>
				<span>赏析</span>
			</p>
			<p class="content">{{obj.master_comment}}</p>
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				obj:{},
				info:{}
			}
		},
		onShareAppMessage(res) {
				wx.showShareMenu({
				     withShareTicket: true,
				     menus: ['shareAppMessage', 'shareTimeline']
				    })
				return{
						title:this.info.title,
						imageUrl:'https://www.leedong.top/img/11556.png',
						path:'/pages/poetrydetail/index?title='+JSON.stringify(this.info)
				}
				
				},
				//2.分享到朋友圈
		onShareTimeline(){
		
			return {
				title:this.info.title,
				imageUrl:'https://www.leedong.top/img/11556.png',
				path:'/pages/poetrydetail/index?title='+JSON.stringify(this.info)
				
			}
		},
		onLoad(options) {
			 this.info=JSON.parse(options.title)
			if(this.info.id==''){
				 this.list(this.info.title)
				
			}else{
				this.obj=this.info
			}
			
			
			
			// this.list(options.title)
		},
		methods:{
			list(t){
				this.$api.details({title:t}).then((res)=>{
					this.obj=res.rows[0];
				
				})
			}
		}
	}
</script>

<style lang="scss">
	.authors{
		width: 100%;
		.shi{
			margin-left: 10px;
			.name{
				font-size: 18px;
				color:$color;
				padding-top: 10px;
			}
			.dynasty{
				color:$uni-text-color-grey;
				font-size: 14px;
			}
			.author{
				color:$uni-color-primary;
				padding-left: 10px;
				font-size: 14px;
			}
			.content{
				margin-top: 10px;
				font-size: 15px;
			
			}
		}
		.authors_details{
		margin-left: 10px;
		margin-top: 20px;
			.name{
					.shu {
						height: 20px;
						display: inline-block;
						width: 4px;
						vertical-align: middle;
						background-color: #7d8468;
					
				}
				span{
					padding-left: 5px;
				}
				
			}
			.content{
				padding: 5px;
				font-size: 14px;
				line-height: 20px;
				color:$color;
			}
			
		}
	}
</style>